/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.joy.db2;

import java.util.LinkedList;
import java.util.List;

/**
 * 
 * @author lamfeeling
 */
public class MergedDocHits {

    private List<Integer[]> pos = new LinkedList<Integer[]>();
    private double score;

    public MergedDocHits() {
    }

    public MergedDocHits(List<Integer[]> pos, double score) {
	this.pos = pos;
	this.score = score;
    }

    public void addDocHit(DocHit hit, double tfIdf) {
	this.pos.add(hit.getPos());
	this.score += hit.getScore() * 1 / (1 + tfIdf);
	assert this.score >= 0;
    }

    public List<Integer[]> getPos() {
	return pos;
    }

    public double getScore() {
	return score;
    }

}
